package subject.lianbiao;

/**
 * 给你一个链表的头节点 head ，判断链表中是否有环。
 */
public class hasCycle {
    public static void main(String[] args) {
        ListNode head = new ListNode(1);

        if(head==null || head.next == null){
            System.out.println("");
        }
        ListNode slow = head;
        ListNode fast = head.next;

        while(slow != fast){
            if(fast == null || fast.next == null){
                System.out.println("");
            }
            fast = fast.next.next;
            slow = slow.next;
        }
        System.out.println("");
    }
}
